package main

import (
	"fmt"
	"strings"
)

func main() {
	fmt.Println(reverseWords("Let's take LeetCode contest"))
}

func reverseWords(s string) string {
	str := strings.Split(s, " ")
	var ret []string
	for _, value := range str {
		ret = append(ret, reverseWord(value))
	}
	return strings.Join(ret, " ")
}

func reverseWord(s string) string {
	var ret []byte
	for i := len(s)-1; i >= 0; i-- {
		ret = append(ret, s[i])
	}
	return string(ret)
}
